package cn.stylefeng.guns.modular.cp;

import cn.hutool.core.util.StrUtil;

import java.util.Arrays;
import java.util.List;

/**
 * @Description TODO
 * @Author xiesm
 * @Date 2024/6/13 9:27
 **/
public class AU10Test {
    public static void main(String[] args) {
        test3();
    }

    public static void test3() {
        for (int i = 1; i <= 10; i++) {
            for (int j = 1; j <= 10; j++) {
                if (i == j) {
                    continue;
                }
                String format = StrUtil.format("{} {}",
                        StrUtil.padPre(i + "", 2, "0"),
                        StrUtil.padPre(j + "", 2, "0"));
                System.out.println(format);
            }
        }
    }

    public static void test1() {
        List<Integer> ids = Arrays.asList(1, 3, 5, 7, 9, 10);
        int num = 1;
        for (int i = 1; i <= 10; i++) {
            for (int j = 1; j <= 10; j++) {
                if (i == j) {
                    continue;
                }
                for (int k = 1; k <= 10; k++) {
                    if (i == j || j == k || i == k) {
                        continue;
                    }
                    for (int l = 1; l <= 10; l++) {
                        if (i == j || j == k || i == k || i == l || j == l || k == l) {
                            continue;
                        }
                        for (int m = 1; m <= 10; m++) {
                            if (i == j || j == k || i == k || i == l || j == l || k == l || i == m || j == m || k == m || l == m) {
                                continue;
                            }
                            if (ids.contains(i) && ids.contains(j) && ids.contains(k) && ids.contains(l) && ids.contains(m)) {
                                System.out.println(num++);
                            }
                        }
                    }
                }
            }
        }
    }

    public static void test2() {
        List<Integer> ids = Arrays.asList(6, 7, 8, 9, 10);
        int num = 1;
        for (int i = 1; i <= 10; i++) {
            for (int j = 1; j <= 10; j++) {
                if (i == j) {
                    continue;
                }
                for (int k = 1; k <= 10; k++) {
                    if (i == j || j == k || i == k) {
                        continue;
                    }
                    for (int l = 1; l <= 10; l++) {
                        if (i == j || j == k || i == k || i == l || j == l || k == l) {
                            continue;
                        }
                        if (ids.contains(i) && ids.contains(j) && ids.contains(k) && ids.contains(l)) {
                            String format = String.format("%s %s %s %s", i, j, k, l);
                            System.out.println(num++ + ":" + format);
                        } else {
                        }
                    }
                }
            }
        }
    }
}
